<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   		<script type="text/javascript">
			var applicationId = "${applicationId}";
   		</script>
   		<%@include file="/commons/resource.jsp" %>
        <script type="text/javascript" src="${ctx}/static/js/app/role.js"></script>
  </head>
	<body class="easyui-layout">
	<!-- Search panel start -->
 	 <div class="ui-search-panel" region="north" style="height: 70px;" title="搜索框" data-options="striped: true,collapsible:true,iconCls:'icon-search',border:false">  
	 	 <form id="searchForm">
	 	 	<p class="ui-fields">
	 	 	    <label class="ui-label">角色名称:</label><input name="roleName" class="easyui-box ui-text" style="width:100px;">
	        </p>
	        <a href="#" id="btn-search" class="easyui-linkbutton" iconCls="icon-search">搜索</a>
	     </form>  
     </div> 
     <!--  Search panel end -->
     
     <!-- DataList  -->
     <div region="center" border="false" >
     	<div id="toolbar">
     	    <perm:hasPermission url="role/add?applicationId=${applicationId}">
     				<a href="#" class="easyui-linkbutton" iconCls="icon-add" id="addBtn" plain="true">新增</a>
     		</perm:hasPermission>
     		 <perm:hasPermission url="role/edit?applicationId=${applicationId}">
     				<a href="#" class="easyui-linkbutton" iconCls="icon-edit" id="editBtn" plain="true">编辑</a>
     		</perm:hasPermission>
     		 <perm:hasPermission url="role/delete?applicationId=${applicationId}">
     				<a href="#" class="easyui-linkbutton" iconCls="icon-remove" id="deleteBtn" plain="true">删除</a>
     		</perm:hasPermission>
     		 <perm:hasPermission url="role/distribution?applicationId=${applicationId}">
     				<a href="#" class="easyui-linkbutton" iconCls="icon-remove" id="distributionBtn" plain="true">分配菜单权限</a>
     		</perm:hasPermission>
     		 <perm:hasPermission url="role/distributionDataSave?applicationId=${applicationId}">
     				<a href="#" class="easyui-linkbutton" iconCls="icon-remove" id="distributionDataBtn" plain="true">分配数据权限</a>
     		</perm:hasPermission>
		
		</div>
     	<table id="data-list"></table>
     </div>

     <!-- Edit Form -->
     <div id="edit-win" class="easyui-dialog" title="角色信息编辑页面" data-options="closed:true,iconCls:'icon-save',modal:true" style="width:400px;height:300px;">  
     	<form id="editForm" class="ui-form" method="post">  
     		 <input class="hidden" type="text" name="roleId">
     		 <input class="hidden" type="text" name="applicationId" value="${applicationId}">
     		 <div class="ui-edit">
	     	   <div class="ftitle">角色信息</div>
	           <div class="fitem">
	               <label>角色名称:</label>
	               <input class="easyui-validatebox" type="text" name="roleName" data-options="required:true">
	           </div>  
	           <div class="fitem">  
	               <label>角色KEY:</label>  
	               <input class="easyui-validatebox" type="text" name="roleKey" data-options="required:true">
	           </div>
	           <div class="fitem">
	               <label>角色描述:</label>  
	               <input class="easyui-validatebox" type="text" name="roleDesc">
	           </div>
	         </div>
     	</form>
  	 </div>
  	 
  	  <!-- distribution Form -->
     <div id="distributionWin" class="easyui-dialog" title="角色菜单授权页面" data-options="closed:true,iconCls:'icon-save',modal:true" style="width:400px;height:300px;">  
     	<form id="distributionForm" class="ui-form" method="post">  
     		 <input class="hidden" type="text" name="roleId">
     		 <input class="hidden" type="text" name="applicationId" value="${applicationId}">
     		  <input class="hidden" type="text" name="menuId" >
     		  <div id="distributionTree" >
     		 
			 
	         </div>
     	</form>
  	 </div>
  	 
  	  <!-- distributionData Form -->
     <div id="distributionDataWin" class="easyui-dialog" title="角色数据授权页面" data-options="closed:true,iconCls:'icon-save',modal:true" style="width:400px;height:300px;">  
     	<form id="distributionDataForm" class="ui-form" method="post" region="center" border="false">
     	 
     		 <input class="hidden" type="text" name="roleId">
     		 <input class="hidden" type="text" name="applicationId" value="${applicationId}">
     		 <input class="hidden" type="text" name="menuId" >
     		  <div class="fitem">
					<label>范围类型:</label> <input id="scopeType" name="scopeType"/>
			</div>
     		  
     		   <table id="distribution-data-list" style="width:100%">
					    	
			   </table>
     		  
     	</form>
  	 </div>
  	 
  </body>
</html>
